package com.phc.a20200511work.competence;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import com.phc.a20200511work.MainActivity;
import com.phc.a20200511work.R;

public class compentence extends AppCompatActivity {

    private Button activityCompentenceButton1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_compentence);
        initView();
        //判断是否有权限 ，动态申请权限
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE)
                != PackageManager.PERMISSION_GRANTED){
            //如果没有授权，就进行授权

        }
        //打电话
        activityCompentenceButton1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(Intent.ACTION_CALL);
//                intent.setData(Uri.parse("10086"));
//                startActivity(intent);
            }
        });

    }

    private void initView() {
        activityCompentenceButton1 = (Button) findViewById(R.id.activity_compentence_button1);
    }
}
